import { NgModule }         from '@angular/core';
import { HttpModule, Http }          from '@angular/http';

import {
  TranslateModule as NgxTranslateModule,
  TranslateLoader,
  //TranslateService,
  //TranslatePipe,
} from '@ngx-translate/core';
import {TranslateHttpLoader} from '@ngx-translate/http-loader';

// AoT requires an exported function for factories
export function HttpLoaderFactory(http: Http) {
  return new TranslateHttpLoader(http, '/assets/i18n/', '.json');
}

@NgModule({
  imports: [
    NgxTranslateModule.forRoot({
      loader: {
        provide: TranslateLoader,
        useFactory: HttpLoaderFactory,
        deps: [Http]
      }
    })
  ],
  exports: [
    //TranslateService,
    //TranslatePipe,
  ]
})
export class TranslateModule { }
